/**      
 * @file		userFillArray.cpp
 * @description	Demonstrates initializing array elements from
 *				standard input
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
#include <cctype>
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {
	// declares the array
	char grades[5];

	cout << "Please type in five grades (A,B,C,D, or F)\n";
	// Arrays are indexed from 0...size-1
	// This loop initializes all the values in the array
	// by getting the value from the user
	for(int i = 0; i < 5; i++) {
		cout << "Grade " << (i+1) << ": ";
		cin  >> grades[i];
	}

	// Arrays are indexed from 0...size-1
	// output the values of grades
	cout << "You typed\n";
	for(int i = 0; i < 5; i++) {
		// we can use array elements as parameters to functions
		// notice the use of static_cast<char>(toupper())
		// the return value of toupper is used as a parameter
		// to the static_cast function
		cout << "Grade " << (i+1) << " = " 
		     << static_cast<char>(toupper(grades[i])) << endl;
	}
	return 0;
}

